Remove pt-en
article thumbnail

Translating Different Content Types Using Helsinki-NLP ML Model from Hugging Face

Perficient Digital Transformation

from transformers import MarianMTModel, MarianTokenizer model_name = "Helsinki-NLP/opus-mt-en-fr" model = MarianMTModel.from_pretrained(model_name) tokenizer = MarianTokenizer.from_pretrained(model_name) Tokenize the input: Before translating the text, we need to tokenize it using the appropriate tokenizer.

article thumbnail

AEM Feature – Author Preview Servlet

Perficient Digital Transformation

For example, using our default endpoint, preview.html, we could render the we-retail root page with the following: /preview.html/content/we-retail/us/en/men.html. Rewrite /(.*) /preview.html/(.*) [PT,L]. This servlet will listen on given endpoint, and from the passed in suffix, determine what content to render. html Rewrite /.+.html/(.*)

Retail 69